package cn.fuxue.hrms.service.process;

import cn.fuxue.hrms.common.base.BaseEntityProcessor;
import cn.fuxue.hrms.common.base.BaseMapper;
import cn.fuxue.hrms.common.entity.CvEduExp;
import cn.fuxue.hrms.mapper.CvEduExpMapper;
import cn.fuxue.hrms.service.CvEduExpService;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.Map;

@Service
public class CvEduExpProcessor extends BaseEntityProcessor<CvEduExp> {
    @Autowired
    private CvEduExpMapper cvEduExpMapper;


    private Integer cvId;

    public Integer getCvId() {
        return cvId;
    }

    public void setCvId(Integer cvId) {
        this.cvId = cvId;
    }

    @Override
    protected CvEduExp validate(Map map) {
        CvEduExp cvEduExp=new CvEduExp();
        try {
            map.put("cvId",getCvId());
            cvEduExp.populateFromJson(map);
            return cvEduExp;
        } catch (Exception e) {
            return cvEduExp;
        }
    }


    @Override
    protected Integer save(CvEduExp entity) {
        return cvEduExpMapper.insert(entity);
    }


}
